#include "User.h"

using namespace gazebo;

void User::Load(physics::WorldPtr _parent, sdf::ElementPtr /*_sdf*/)
{
  // Store the pointer to the model
  this->world = _parent;

  // Listen to the update event. This event is broadcast every
  // simulation iteration.
  this->updateConnection = event::Events::ConnectWorldUpdateBegin(
  boost::bind(&User::OnUpdate, this, _1));
  /***********************LaymanYang***********************/
  Jump.Load(this->world);
  /********************************************************/
}

// Called by the world update start event
void User::OnUpdate(const common::UpdateInfo & /*_info*/)
{
  /***********************LaymanYang***********************/
  Jump.Control_Height(2,MASS_LEG,SPRING_K);
  /********************************************************/

}

